package sprites;

import java.awt.image.BufferedImage;

import com.golden.gamedev.GameObject;

/**
 * The protagonist of the game, controlled by the player.
 */
public class Bob extends BubblefishBobSprite
{

    public Bob(GameObject owner, double x, double y)
    {
        super(owner, owner.getImages("resources/images/bob_0000.png", 10, 1),
                x, y);

        setAnimate(true);
        setLoopAnim(true);

        /*
         * 290 is the value from ProgBob. It's near the bottom of the screen.
         */
        setY(290);
    }

    @Override
    public void update(long elapsedTime)
    {
        super.update(elapsedTime);

        /*
         * Make Bob follow the mouse. -23 compensates for Bob's width when the
         * mouse is near the screen edges.
         */
        setX(myOwner.getMouseX() - 23);
    }

}
